home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / isconn_1 / main1.frm < prev    next >
Text File  |  1999-08-31  |  23KB  |  781 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    BorderStyle     =   1  'Fixed Single
  6.    ClientHeight    =   10965
  7.    ClientLeft      =   15
  8.    ClientTop       =   15
  9.    ClientWidth     =   9210
  10.    ControlBox      =   0   'False
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MDIChild        =   -1  'True
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   10965
  16.    ScaleWidth      =   9210
  17.    Begin VB.PictureBox picHandle 
  18.       Appearance      =   0  'Flat
  19.       BackColor       =   &H8000000D&
  20.       BorderStyle     =   0  'None
  21.       BeginProperty Font 
  22.          Name            =   "MS Sans Serif"
  23.          Size            =   8.25
  24.          Charset         =   0
  25.          Weight          =   700
  26.          Underline       =   0   'False
  27.          Italic          =   0   'False
  28.          Strikethrough   =   0   'False
  29.       EndProperty
  30.       ForeColor       =   &H80000008&
  31.       Height          =   375
  32.       Index           =   0
  33.       Left            =   2520
  34.       ScaleHeight     =   375
  35.       ScaleWidth      =   375
  36.       TabIndex        =   1
  37.       Top             =   2640
  38.       Visible         =   0   'False
  39.       Width           =   375
  40.    End
  41.    Begin VB.Label Label3 
  42.       Alignment       =   2  'Center
  43.       BorderStyle     =   1  'Fixed Single
  44.       Caption         =   "  Html code  "
  45.       Height          =   255
  46.       Index           =   0
  47.       Left            =   3120
  48.       TabIndex        =   3
  49.       ToolTipText     =   "Html code"
  50.       Top             =   1440
  51.       Visible         =   0   'False
  52.       Width           =   960
  53.    End
  54.    Begin VB.Label Label2 
  55.       BackColor       =   &H00000000&
  56.       Height          =   30
  57.       Index           =   0
  58.       Left            =   1800
  59.       TabIndex        =   2
  60.       ToolTipText     =   "Line"
  61.       Top             =   480
  62.       Visible         =   0   'False
  63.       Width           =   3015
  64.    End
  65.    Begin VB.Shape Shape1 
  66.       Height          =   975
  67.       Index           =   0
  68.       Left            =   1560
  69.       Top             =   960
  70.       Visible         =   0   'False
  71.       Width           =   1335
  72.    End
  73.    Begin VB.Image Image1 
  74.       Appearance      =   0  'Flat
  75.       BorderStyle     =   1  'Fixed Single
  76.       Height          =   1455
  77.       Index           =   0
  78.       Left            =   360
  79.       Top             =   1560
  80.       Visible         =   0   'False
  81.       Width           =   1335
  82.    End
  83.    Begin VB.Label Label1 
  84.       Alignment       =   2  'Center
  85.       Appearance      =   0  'Flat
  86.       BackColor       =   &H80000005&
  87.       BackStyle       =   0  'Transparent
  88.       BorderStyle     =   1  'Fixed Single
  89.       Caption         =   "Add Text"
  90.       BeginProperty Font 
  91.          Name            =   "Arial"
  92.          Size            =   12
  93.          Charset         =   0
  94.          Weight          =   400
  95.          Underline       =   0   'False
  96.          Italic          =   0   'False
  97.          Strikethrough   =   0   'False
  98.       EndProperty
  99.       ForeColor       =   &H80000008&
  100.       Height          =   255
  101.       Index           =   0
  102.       Left            =   240
  103.       TabIndex        =   0
  104.       ToolTipText     =   "Text"
  105.       Top             =   240
  106.       Visible         =   0   'False
  107.       Width           =   1335
  108.    End
  109. End
  110. Attribute VB_Name = "Form1"
  111. Attribute VB_GlobalNameSpace = False
  112. Attribute VB_Creatable = False
  113. Attribute VB_PredeclaredId = True
  114. Attribute VB_Exposed = False
  115. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
  116. Private Declare Function ClipCursor Lib "user32" (lpRect As Any) As Long
  117. Private Declare Function ReleaseCapture Lib "user32" () As Long
  118. Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  119. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  120. Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
  121. Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
  122. Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
  123. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  124. Private Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
  125. Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
  126. Private Declare Function SetROP2 Lib "gdi32" (ByVal hdc As Long, ByVal nDrawMode As Long) As Long
  127. Private Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long) As Long
  128.  
  129. Private Const NULL_BRUSH = 5
  130. Private Const PS_SOLID = 0
  131. Private Const R2_NOT = 6
  132.  
  133. Enum ControlState
  134.     StateNothing = 0
  135.     StateDragging
  136.     StateSizing
  137. End Enum
  138.  
  139. Private m_CurrCtl As Control
  140. Private m_DragState As ControlState
  141. Private m_DragHandle As Integer
  142. Private m_DragRect As New CRect
  143. Private m_DragPoint As POINTAPI
  144.  
  145. Private Type POINTAPI
  146.     X As Long
  147.     Y As Long
  148. End Type
  149.  
  150. Private Type RECT
  151.     Left As Long
  152.     Top As Long
  153.     Right As Long
  154.     Bottom As Long
  155. End Type
  156. Sub zoomup(vle As Integer)
  157. On Error Resume Next
  158. Dim i As Integer
  159.  
  160. Form1.Width = Form1.Width * vle
  161. Form1.Height = Form1.Height * vle
  162. Form1.ShowHandles False
  163. For i = 0 To Form1.Controls.Count - 1
  164. Form1.Controls(i).Left = Form1.Controls(i).Left * vle
  165. Form1.Controls(i).Top = Form1.Controls(i).Top * vle
  166. Form1.Controls(i).Width = Form1.Controls(i).Width * vle
  167. Form1.Controls(i).Height = Form1.Controls(i).Height * vle
  168. Form1.Controls(i).FontSize = Form1.Controls(i).FontSize * vle
  169. Next i
  170. zoo = zoo + 1
  171. End Sub
  172. Sub zoomdown(vle As Integer)
  173. On Error Resume Next
  174. Dim i As Integer
  175.  
  176. Form1.Width = Form1.Width / vle
  177. Form1.Height = Form1.Height / vle
  178. Form1.ShowHandles False
  179. For i = 0 To Form1.Controls.Count - 1
  180. Form1.Controls(i).Left = Form1.Controls(i).Left / vle
  181. Form1.Controls(i).Top = Form1.Controls(i).Top / vle
  182. Form1.Controls(i).Width = Form1.Controls(i).Width / vle
  183. Form1.Controls(i).Height = Form1.Controls(i).Height / vle
  184. Form1.Controls(i).FontSize = Form1.Controls(i).FontSize / vle
  185. Next i
  186. zoo = zoo - 1
  187. End Sub
  188. Sub ShowHandles(Optional bShowHandles As Boolean = True)
  189.     Dim i As Integer
  190.     Dim xFudge As Long, yFudge As Long
  191.     Dim nWidth As Long, nHeight As Long
  192.  
  193.     If bShowHandles And Not m_CurrCtl Is Nothing Then
  194.         With m_DragRect
  195.            
  196.             nWidth = (picHandle(0).Width \ 2)
  197.             nHeight = (picHandle(0).Height \ 2)
  198.             xFudge = (0.5 * Screen.TwipsPerPixelX)
  199.             yFudge = (0.5 * Screen.TwipsPerPixelY)
  200.            
  201.             picHandle(0).Move (.Left - nWidth) + xFudge, (.Top - nHeight) + yFudge
  202.             
  203.             picHandle(4).Move (.Left + .Width) - nWidth - xFudge, .Top + .Height - nHeight - yFudge
  204.           
  205.             picHandle(1).Move .Left + (.Width / 2) - nWidth, .Top - nHeight + yFudge
  206.            
  207.             picHandle(5).Move .Left + (.Width / 2) - nWidth, .Top + .Height - nHeight - yFudge
  208.           
  209.             picHandle(2).Move .Left + .Width - nWidth - xFudge, .Top - nHeight + yFudge
  210.          
  211.             picHandle(6).Move .Left - nWidth + xFudge, .Top + .Height - nHeight - yFudge
  212.          
  213.             picHandle(3).Move .Left + .Width - nWidth - xFudge, .Top + (.Height / 2) - nHeight
  214.             
  215.             picHandle(7).Move .Left - nWidth + xFudge, .Top + (.Height / 2) - nHeight
  216.         End With
  217.     End If
  218.   
  219.     For i = 0 To 7
  220.         picHandle(i).Visible = bShowHandles
  221.     Next i
  222. End Sub
  223. Private Sub DrawDragRect()
  224.     Dim hPen As Long, hOldPen As Long
  225.     Dim hBrush As Long, hOldBrush As Long
  226.     Dim hScreenDC As Long, nDrawMode As Long
  227.  
  228.    
  229.     hScreenDC = GetDC(0)
  230.   
  231.     hPen = CreatePen(PS_SOLID, 2, 0)
  232.     hOldPen = SelectObject(hScreenDC, hPen)
  233.     hBrush = GetStockObject(NULL_BRUSH)
  234.     hOldBrush = SelectObject(hScreenDC, hBrush)
  235.     nDrawMode = SetROP2(hScreenDC, R2_NOT